﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MYQQX.SP
{
    public class Yq_wm : ISp
    {
        public override string Name => "禺期·无名";

        public override string Desc => @"技能效果一：增加昭明、古剑晗光、无名之剑的出现概率
技能效果二：自身能形成的组合每个增加10分";

        public override int GetExtraScore(CardGroup group)
        {
            return group.Group.Count(t => t.groups.Contains("禺期")) * 10;
        }

        public override void Got(CardGroup MyGroup, CardGroup OtGroup)
        {
            MainForm.ContinueSend += ThisSend;
        }

        public override void Lost()
        {
            MainForm.ContinueSend -= ThisSend;
        }


        private Card ThisSend(List<Card> cards)
        {
            if (Guid.NewGuid().GetHashCode() % 10 <= 3)
            {   // 30%的几率触发
                return cards.FirstOrDefault(t => t.Name == "昭明"
                || t.Name == "古剑晗光"
                || t.Name == "无名之剑");
            }
            return null;
        }
    }
}
